#
# Copyright (c) 2013 Tang, Haifeng <tanghaifeng-gz@loongson.cn>
#
# SPDX-License-Identifier:	GPL-2.0+
#

include $(TOPDIR)/config.mk

ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)board/$(VENDOR)/common)
endif

LIB	= $(obj)lib$(VENDOR).o

SOBJS	= lowlevel_init.o cmd_update.o loongson_update.o
COBJS-$(CONFIG_CPU_LOONGSON1A)	+= ddr2_config_1a_CL3.o
ifdef CONFIG_DDR_CL5
COBJS-y	+= ddr2_config_CL5.o
else ifdef CONFIG_DDR_CL3
COBJS-y	+= ddr2_config_CL3.o
endif
COBJS-$(CONFIG_VIDEO)	+= ls1x_video.o
COBJS-$(CONFIG_TL2796)	+= tl2796.o
COBJS-y += tlb.o

COBJS	:= $(COBJS-y)
SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
OBJS	:= $(addprefix $(obj),$(COBJS))
SOBJS	:= $(addprefix $(obj),$(SOBJS))

$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
	$(call cmd_link_o_target, $(OBJS) $(SOBJS))

#########################################################################

# defines $(obj).depend target
include $(SRCTREE)/rules.mk

sinclude $(obj).depend

#########################################################################
